#include <iostream>
#include <chrono>

class TicToc{
public:
TicToc(){
t_start_ = std::chrono::steady_clock::now();
}

double toc(){
t_end_ = std::chrono::steady_clock::now();
time_used_ = std::chrono::duration<double>(t_end_ - t_start_).count();
t_start_ = std::chrono::steady_clock::now();
return time_used_;
}

private:
std::chrono::steady_clock::time_point t_start_ ;
std::chrono::steady_clock::time_point t_end_;
double time_used_;
};